<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>插件</title>
  <script src="../vue.js"></script>
</head>
<body>
  <div id="app">
    {{$globalData.name}}
    <Child></Child>
    <global-component></global-component>
    <div>
      <button @click="$changeGlobalData('zhangcong')">change data</button>
      <button @click="showMsg('hello')">show</button>
    </div>
    <div>
      <button v-myon:click="handleMyOnClick">我的事件测试</button>
    </div>
  </div>
  <script type="module">
    import './Child.js'
    import { MyPlugin } from './my-plugins.js'
    Vue.use(MyPlugin, { age: 20 })

    new Vue({
      el: '#app',

      mounted() {
        console.log(this.$globalData.age)
      },

      abc() {
        console.log(100)
      },

      methods: {
        handleMyOnClick() {
          console.log('clicked.')
        }
      },
    })
  </script>
</body>
</html>